<template>
	<el-table :data="orderList" border style="width: 100%">
		<el-table-column fixed prop="id" label="ID" width="150">
		</el-table-column>
		<el-table-column prop="name" label="名称" width="120">
		</el-table-column>
		<el-table-column prop="uid" label="UID" width="120">
		</el-table-column>
		<el-table-column fixed="right" label="操作" width="100">
			<template slot-scope="scope">
				<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
				<el-button type="text" size="small">编辑</el-button>
			</template>
		</el-table-column>
	</el-table>
</template>

<script>
	import axios from "axios"
	export default {
		methods: {
			handleClick(row) {
				console.log(row);
				console.log(row.id);
				this.$router.push({
					path: "/orderDeatils",
					query: {
						id: row.id
					},
				});

			}
		},

		created() {
			axios.get('http://localhost:8100/api-order/v1/admin/order/findAll').then(res => {
				this.orderList = res.data.data;
			})
		},

		data() {
			return {
				tableData: [],
				orderList: []
			}
		}
	}
</script>

<style>
</style>